1. Technical Field
The present invention relates to firmware in general, and particularly to a method for updating firmware of a hard disk drive within a computer in a power-on state.
2. Description of Related Art
Electronic devices, such as hard disk drives (HDDs) and solid state drives (SSDs), commonly store a program code named firmware in a non-volatile memory (NVRAM). Such firmware is updated as needed by the manufacturer of the electronic devices, and so a user is required to update old firmware with new firmware that is acquired through a network or a recording medium. One update method is performed under the operating environment of a disk operating system (DOS). In another update method, after a NVRAM is updated under the operating environment of the operating system (OS) as well, old firmware executed by a volatile memory, such as a dynamic random access memory (DRAM), is continued until the next reboot, and after the reboot, new firmware is executed.
A HDD can be configured to load firmware stored in a NVRAM into a built-in DRAM at the time of power-on reset (hardware reset) or CPU reset (software reset) to enable the CPU to execute the firmware. The OS issues a command at the process of cold boot to let the computer transition from the power-off state to the power-on state, thus acquiring identification information of an electronic device implemented in the computer at that time.
For instance, the OS issues an IDENTIFY DEVICE command specified by Advanced Technology Attachment (ATA) to acquire information from a HDD to specify the HDD, such as a model name, version, an updating date, serial number, or capacity. Such a group of information to specify an electronic device is called identification information hereinafter. When the computer finishes cold boot, the OS recognizes that the electronic device specified by the identification information and implements the firmware before updating is connected.
If trouble happens in the HDD during the operation using an application program running under the operating environment of the OS, a user may update firmware. Although the user wishes to update the firmware soon to use the HDD, the above-mentioned two conventional updating methods cannot meet such a request. When firmware is updated in the power-on state, the HDD itself resets the CPU immediately, and loads the updated firmware into the DRAM for execution. This is called activation. When being activated, the HDD operates in accordance with the updated firmware.
In the case of Windows® OS, the OS may issue an ATA command of IDENTIFY DEVICE during the power-on state, and acquire identification information from an electronic device, such as a HDD, implemented in the computer. If the firmware has been updated, the electronic device sends back the identification information of the updated firmware that is loaded in the DRAM in response to the ATA command from the OS. Then, the OS compares the received identification information with identification information before the update that is acquired during the cold boot process. If they do not agree, the OS will think that a new electronic device is running without cold boot being performed first, and displays a “blue screen.”
The “blue screen” is a screen that, in response to an occurrence of a fatal error in the OS, displays an error message in white letters on a blue background screen after the computer system has been stopped. When the “blue screen” is displayed, the user has to shut down the system forcibly for recovery in many cases, or the system may shut down automatically. In either case, if the “blue screen” occurs, any data that is not saved at the time will disappear.
When cold boot is performed after shut down, the OS acquires the latest identification information of firmware that is updated during the cold boot. After that, blue screen will not be displayed because the identification information acquired during the cold boot and the identification information acquired in the state of power-on agree. However, there is a user's demand to, under the operating environment of an OS that does not permit the continuous execution of firmware that is updated in the power-on state without performing cold boot, operate an electronic device with the updated firmware immediately after the firmware update has taken place in the power-on state.
Consequently, it would be preferable to provide an improved method for enabling a computer to use an updated firmware without performing cold boot after the firmware has been updated during the power-on state.